<template>
	<view class="item-top">
		<!-- 昵称 -->
		<view class="nick">{{nick}}</view>
		<!-- 性别+年龄 -->
		<view class="sex-age sex-girl" v-if="2==sex && age">
			<image :src="getImageUrl('ic_sex_girl_white.png')" style="width: 22rpx;" mode="widthFix"></image>
			<view class="age">{{age}}</view>
		</view>
		<view class="sex-age sex-boy" v-if="1==sex && age">
			<image :src="getImageUrl('ic_sex_boy_white.png')" style="width: 22rpx;" mode="widthFix"></image>
			<view class="age">{{age}}</view>
		</view>
		<!-- 真人 -->
		<view class="real">
			<image class="icon" mode="heightFix" v-if="0==real && 2==sex" :src="getImageUrl('ic_zhenren_gril.png')"></image>
			<image class="icon" mode="heightFix" v-if="0==real && 1==sex" :src="getImageUrl('ic_zhenren_boy.png')"></image>
		</view>
		<!-- 在线 -->
		<view class="online">
			<image class="icon" mode="heightFix" v-if="0==online" :src="getImageUrl('ic_online.png')"></image>
		</view>
		<!-- vip -->
		<view class="vip">
			<image class="icon" mode="heightFix" v-if="0==vip" :src="getImageUrl('home_vip.png')"></image>
		</view>
	</view>
</template>

<script>
	export default {
		name:"item-top",
		data() {
			return {
				
			};
		},
		props:{
			nick:{
				type: String
			},
			sex:{
				type: Number
			},
			age:{
				type: Number
			},
			real:{
				type: String
			},
			online:{
				type: Number
			},
			vip:{
				type: Number,
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item-top{
		display: flex;
		flex-direction: row;
		align-items: center;
		.nick{
			font-size: 32rpx;
			color: #222;
		}
		.icon{
			height: 25rpx; 
			margin-left: 10rpx;
		}
		
		.sex-age{
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
			border-radius: 100rpx;
			padding: 2rpx 8rpx;
			margin-left: 10rpx;
			.age{
				font-size: 10rpx;
				color: #fff;
			}
		}
		.sex-girl {
			background-color: #fa6adc;
		}
		.sex-boy {
			background-color: #007AFF;
		}
	}

</style>